package com.juyu.miliao.common.constant;

import lombok.Getter;

/**
 * 密语星球缓存key
 *
 * @author xuanqicheng
 * @create 2019-04-14:34
 */
public interface SecretLanguagePlanetRedisKey {

    /**
     * 根据日期与用户id获取列表
     */
    enum SecretLanguagePlanetListByUserId{
        /**
         * 根据日期用户id获取列表
         */
        REDIS_KEY(RedisKeyPrefix.MI_LIAO_API_KEY + "SecretLanguagePlanetListByTimeAndUserId:%s:%s",
                "根据用户id获取列表的缓存key,string结构，格式:SecretLanguagePlanetListByTimeAndUserId:{日期(yyyy-MM-dd)}:{用户id}");

        private String key;

        @Getter
        private String message;

        SecretLanguagePlanetListByUserId(String key, String message) {
            this.key = key;
            this.message = message;
        }

        public String getKeyFormat(String time,String userId){
            return String.format(REDIS_KEY.key,time,userId);
        }
    }

    /**
     * 密语听取次数缓存key
     */
    enum TheNumberOfHearingSecretLanguage{

        /**
         * 密语听取次数缓存key
         */
        REDIS_KEY(RedisKeyPrefix.MI_LIAO_API_KEY + "SecretLanguageOfNumbersByTimeAndUserId:%s:%s",
                "密语听取次数缓存key,string结构，格式:SecretLanguageOfNumbersByTimeAndUserId:{日期(yyyy-MM-dd)}:{用户id}");

        private String key;

        @Getter
        private String message;

        TheNumberOfHearingSecretLanguage(String key, String message) {
            this.key = key;
            this.message = message;
        }

        public String getKeyFormat(String time,String userId){
            return String.format(REDIS_KEY.key,time,userId);
        }
    }

    /**
     * 用户偷听最新秘密 Newest
     */
    enum SecretLanguagePlanetNewestByUserId{
        /**
         * 用户偷听最新秘密缓存key
         */
        REDIS_KEY(RedisKeyPrefix.MI_LIAO_API_KEY + "SecretLanguagePlanetNewestByUserId:%s",
                "用户偷听最新秘密缓存key,string结构，格式:SecretLanguagePlanetNewestByUserId:{用户id}");

        private String key;

        @Getter
        private String message;

        SecretLanguagePlanetNewestByUserId(String key, String message) {
            this.key = key;
            this.message = message;
        }

        public String getKeyFormat(String userId){
            return String.format(REDIS_KEY.key,userId);
        }
    }
}
